package away3d.animators.data ;


import away3d.materials.passes.MaterialPassBase ;



/**
 * The NullAnimation class provides a null object to indicate no animation is performed. This is usually set as default.
 */
class NullAnimation extends AnimationBase
{
    
    
    /**
     * @inheritDoc
     */
    public override function getAGALVertexCode( pass: MaterialPassBase ) : String
    {
        
        var attributes  = pass.getAnimationSourceRegisters() ;
        var targets     = pass.getAnimationTargetRegisters() ;
        var code        = "" ;
        
        // simply write attributes to targets, do not animate them
        // projection will pick up on targets[0] to do the projection
        for( i in 0...attributes.length )
        {
            
            code += "mov " + targets[ i ] + ", " + attributes[ i ] + "\n";
            
        }
        
        return code;
        
    }
    
    
    /**
     * @inheritDoc
     */
    public override function createAnimationState() : AnimationStateBase
    {
        
        return null;
        
    }
    
    
    /**
     * @inheritDoc
     */
    public override function equals( animation : AnimationBase ) : Bool
    {
        // TODO: Need to recheck this line
        return Std.is( animation, NullAnimation );
        
    }
    
    
}